<template>
	<cl-select-table
		v-model="value"
		:title="'选择商品信息'"
		:service="service.package.info"
		:columns="columns"
		:multiple="multiple"
		:dict="{ text: 'name' }"
		pickerType="table"
	/>
</template>

<script setup lang="ts">
defineOptions({
	name: 'package-select'
});

import { useCool } from '/@/cool';
import { useI18n } from 'vue-i18n';
import { CrudProps } from '/#/crud';
import { reactive, ref, useModel } from 'vue';
import { useDict } from '/$/dict';
const { dict } = useDict();

const props = defineProps({
	...CrudProps,
	modelValue: null,
	multiple: true
});

const { service } = useCool();
const { t } = useI18n();

const value = useModel(props, 'modelValue');

const columns = ref([
	{ label: t('名称'), prop: 'name', minWidth: 140 },
	{ label: t('价格'), prop: 'price', minWidth: 140, sortable: 'custom' }
]);
</script>
